<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ECMAScript 引用类型</title>
</head>
<body>
<script>
    var m = new Object();
    m.userName = '雨夜';
    m.msg = function () {
        return 'msg';
    };
    var hasOwnProperty = m.hasOwnProperty('userName');
    console.log(`hasOwnProperty: ${hasOwnProperty}`);
    console.log('------------------------');

    var b = new Object();
    var c = m;
    console.log(`isPrototypeOf: ${m.isPrototypeOf(b)}`);
    console.log(`isPrototypeOf: ${m.isPrototypeOf(c)}`);
    console.log('------------------------\t');

    var d = {name: '上海', address: '上海市', person: {age: 1, sex: 'man'}};
    console.log(`propertyIsEnumerable: ${m.propertyIsEnumerable('userName')}`);
    console.log(`propertyIsEnumerable: ${m.propertyIsEnumerable('msg')}`);
    console.log(`propertyIsEnumerable: ${d.propertyIsEnumerable('person')}`);
    console.log('------------------------\t');

    var oFalseObject = new Object(false);
    var bResult = oFalseObject && true;
    console.log(oFalseObject.toString());
    console.log(bResult);

    console.log('------------------------\t');
    var e = new String('字符串-ABC');
    console.log(e.toLocaleLowerCase())
    console.log(e.toLocaleUpperCase())
    console.log(typeof e);
    console.log((e instanceof String));
</script>
</body>
</html>
